<script type="text/javascript" language="javascript" src="/gaf/js/common.js"></script>
<script type="text/javascript" language="javascript" src="/pub2/mootools.js"></script>
<script type="text/javascript" language="javascript" src="/pub2/source/FancyUpload2.js"></script>
<script type="text/javascript" language="javascript" src="/pub2/source/Fx.ProgressBar.js"></script>
<script type="text/javascript" language="javascript" src="/pub2/source/Swiff.Uploader.js"></script>
<link rel="stylesheet" type="text/css" href="/gaf/css/base.css" />
<link rel="stylesheet" type="text/css" href="/gaf/css/common.css" />
<link rel="stylesheet" type="text/css" href="/gaf/css/table_def.css" />
<p>酒店管理/修改客房信息</p>
<a href="#" id="demo-attach">Attach a file</a>
<ul id="demo-list"></ul>
<a href="#" id="demo-attach-2" style="display: none;">Attach another file</a>
<script>
window.addEvent('domready', function() {
 
	/**
	 * Uploader instance
	 */
	var up = new FancyUpload3.Attach('demo-list', '#demo-attach, #demo-attach-2', {
		path: '/pub2/source/Swiff.Uploader.swf',
		url: '../script.php',
		fileSizeMax: 2 * 1024 * 1024,
 
		verbose: true,
 
		onSelectFail: function(files) {
			files.each(function(file) {
				new Element('li', {
					'class': 'file-invalid',
					events: {
						click: function() {
							this.destroy();
						}
					}
				}).adopt(
					new Element('span', {html: file.validationErrorMessage || file.validationError})
				).inject(this.list, 'bottom');
			}, this);	
		},
 
		onFileSuccess: function(file) {
			new Element('input', {type: 'checkbox', 'checked': true}).inject(file.ui.element, 'top');
			file.ui.element.highlight('#e6efc2');
		},
 
		onFileError: function(file) {
			file.ui.cancel.set('html', 'Retry').removeEvents().addEvent('click', function() {
				file.requeue();
				return false;
			});
 
			new Element('span', {
				html: file.errorMessage,
				'class': 'file-error'
			}).inject(file.ui.cancel, 'after');
		},
 
		onFileRequeue: function(file) {
			file.ui.element.getElement('.file-error').destroy();
 
			file.ui.cancel.set('html', 'Cancel').removeEvents().addEvent('click', function() {
				file.remove();
				return false;
			});
 
			this.start();
		}
 
	});
 
});
</script>